//
//  HLContactCell.m
//  zhuanxian
//
//  Created by zhaoliang chen on 2017/11/19.
//  Copyright © 2017年 huiling. All rights reserved.
//

#import "HLContactCell.h"

@interface HLContactCell()

@property(nonatomic,strong)UILabel* labelName;
@property(nonatomic,strong)UILabel* labelPhone;

@end

@implementation HLContactCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self.contentView addSubview:self.labelName];
        [self.labelName mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.mas_equalTo(self.contentView.mas_centerY).offset(-10);
            make.left.mas_equalTo(10);
        }];
        
        [self.contentView addSubview:self.labelPhone];
        [self.labelPhone mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.contentView.mas_centerY).offset(10);
            make.left.mas_equalTo(10);
        }];
    }
    return self;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setConsignee:(HLConsigneeObject *)consignee {
    _consignee = consignee;
    self.labelName.text = _consignee.consigneeName;
    self.labelPhone.text = _consignee.consigneeTel;
}

- (void)setConsignor:(HLConsignorObject *)consignor {
    _consignor = consignor;
    self.labelName.text = _consignor.consignorName;
    self.labelPhone.text = _consignor.consignorTel;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (UILabel*)labelName {
    if (!_labelName) {
        _labelName = [UILabel new];
    }
    return _labelName;
}

- (UILabel*)labelPhone {
    if (!_labelPhone) {
        _labelPhone = [UILabel new];
    }
    return _labelPhone;
}

@end
